/**
 * Copyright 2012 Pablo Danilo Aliscioni
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package ar.com.pabloaliscioni.cloud.core.storage;

import ar.com.pabloaliscioni.cloud.api.IStorageClient;
import ar.com.pabloaliscioni.cloud.core.configuration.ProviderConfiguration;

/**
 * Base implementation of the IStorageClient interface from where all concrete implementations should inherit
 * 
 * @author Pablo Danilo Aliscioni
 * @since 1.0
 */
public abstract class BaseStorageClient implements IStorageClient
{
	private String providerName;
	
	@Override
	public String getProviderName()
	{
		return providerName;
	}
	
	protected void setProviderName(String providerName)
	{
		this.providerName = providerName;
	}
	
	/**
	 * Configures the storage client according to the given configuration
	 * 
	 * @param providerConfiguration Configuration to be used in the current storage client
	 */
	public abstract void configure(ProviderConfiguration providerConfiguration);
	
	/**
	 * Checks if a string is valid for use as a container name
	 * 
	 * @param containerName String to validate
	 * @return Boolean value indicating if the string is valid or not
	 */
	public abstract boolean isValidContainerName(String containerName);
    
	/**
	 * Checks if a string is valid for use as a file name
	 * 
	 * @param fileName String to validate
	 * @return Boolean value indicating if the string is valid or not
	 */
	public abstract boolean isValidFileName(String fileNname);
}
